function displayCountBlock(e,forceShow){
	var block = $(e).attr("block");
	$("#blocked tr.totalRoomtypeBlock[block="+block+"]").remove();
	if($("tr[block="+block+"][roomtype]").is(":visible") || (forceShow!=null&&forceShow)){
		$("tr[block="+block+"][roomname]").css("display","none");
		$("tr[block="+block+"][roomtype]").css("display","none");
		$("tr.totalRoomtypeBlock[block="+block+"]").css("display","none");
		var totalEl = $("tr.totalcheckinroom").clone().attr("class","totalRoomtypeBlock").attr("block",block);
		totalEl.find("td.cell").html("");
		$(e).after(totalEl);

		var roomList = $("tr[block="+block+"][roomname]");
		CalcTotalRoomCount(roomList,totalEl);
		totalEl.click(function(){
			var e = $("tr[block="+$(this).attr("block")+"]:not([roomname]):not(.totalRoomtypeBlock)")[0];
			displayCountBlock(e);
		});
	}
	else{
		$("tr[block="+block+"][roomname]").css("display","")
		$("tr[block="+block+"][roomtype]").css("display","");
		$("tr.totalRoomtypeBlock[block="+block+"]").css("display","");
	}
}

function displayCountRoomType(e,forceShow)
{
	var rmtype = $(e).attr("roomtype");
	$("#blocked tr.totalRoomtypeBlock[roomtype="+rmtype+"]").remove();
	if($("tr[roomtype="+rmtype+"][roomname]").is(":visible") || (forceShow!=null&&forceShow)){
		$("tr[roomtype="+rmtype+"][roomname]").css("display","none");
		var totalEl = $("tr.totalcheckinroom").clone().attr("class","totalRoomtypeBlock").attr("roomtype",rmtype).attr("block",$(e).attr("block"));
		totalEl.find("td.cell").html("");
		$(e).after(totalEl);

		var roomList = $("tr[roomtype="+rmtype+"][roomname]");
		CalcTotalRoomCount(roomList,totalEl);
		totalEl.click(function(){
			var e = $("tr[roomtype="+$(this).attr("roomtype")+"]:not([roomname]):not(.totalRoomtypeBlock)")[0];
			displayCountRoomType(e);
		});
	}
	else{
		$("tr[roomtype="+rmtype+"][roomname]").css("display","")
	}
}